
export function debounce(callback, wait=300) {
  let timer = null

  return function(...args){
    if (timer) {
      clearTimeout(timer)
    }

    timer = setTimeout(() => {
      callback.call(this, ...args)
      timer = null
    }, wait)
    
  }
}
